package top.huhuiyu.spirngboot2.total.service.message.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import top.huhuiyu.spirngboot2.total.base.BaseResult;
import top.huhuiyu.spirngboot2.total.dao.message.TbMessageReplyDAO;
import top.huhuiyu.spirngboot2.total.entity.AuthInfo;
import top.huhuiyu.spirngboot2.total.entity.message.TbMessageReply;
import top.huhuiyu.spirngboot2.total.service.message.TbMessageReplyService;
import top.huhuiyu.spirngboot2.total.utils.AuthInfoUtils;

@Service
@Slf4j
@RequiredArgsConstructor
public class TbMessageReplyServiceImpl implements TbMessageReplyService {

    private final TbMessageReplyDAO tbMessageReplyDAO;

    @Override
    public BaseResult add(TbMessageReply tbMessageReply) {
        AuthInfo authInfo = AuthInfoUtils.authInfo();
        tbMessageReply.setUid(authInfo.getUserId());
        tbMessageReplyDAO.insert(tbMessageReply);
        return BaseResult.ok("添加成功");
    }



}
